<template>
<div>
  
             <ul class="mui-table-view" v-for="(item,index) in news" :key="index">
				<li class="mui-table-view-cell mui-media" v-for="items in item" :key="items.docid">
                    
					<router-link :to="'/home/newsinfo/'+items.docid">
                   
						<img class="mui-media-object mui-pull-left" :src="items.picInfo.url">
						<div class="mui-media-body">
							<h1>{{items.title}}</h1>
							<p class="mui-ellipsis"><span>{{items.source}}:{{items.category}}:{{items.digest}}</span><span>{{items.ptime}}</span></p>
						</div>
					</router-link>
                    
				</li>
			
			</ul>
              <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="(item,index) in newslist" :key="index">
					<router-link :to="'/home/newsinfo/'+item.bid">
						<img class="mui-media-object mui-pull-left" :src="item.book_cover">
						<div class="mui-media-body">
							<h1>1{{item.introduction}}</h1>
							<p class="mui-ellipsis"><span>{{item.bookname}}:{{item.class_name}}</span><span>{{item.topic}}</span></p>
						</div>
					</router-link>
				</li>
			
			</ul>
           </div> 
</template>
<script>
import {Toast} from "mint-ui"
    export default{
        data(){
            return{
                newslist:[],
                news:[]
            }
        },
        created(){
         this.getnewslist();
         this.getlist();
        },
        methods:{
            getnewslist(){
                this.$http.get("https://www.apiopen.top/novelApi").then(result =>{
                    // console.log(result.data.data);
                    if(result.data.code===200){
                        this.newslist=result.data.data;
                        // Toast("成功")
                    }else{
                        Toast("失败")
                    }
                })
            },
            
                 getlist(){
                     
                this.$http.get("https://www.apiopen.top/journalismApi").then(result =>{
                    console.log(result.data.data);
                    
                    if(result.data.code===200){
                        this.news=result.data.data;
                        // Toast("成功")
                    }else{
                        Toast("失败")
                    }
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
.mui-table-view{
    li{
       h1{
       font-size: 14px;
    } 
    .mui-ellipsis{
        font-size: 10px;
        color: blue;
        display: flex;
        justify-content: space-between;
    }
    }
    
}
</style>
